package ar.com.sgsvm.logic;

import java.util.List;



import ar.com.sgsvm.dao.DaoFactory;
import ar.com.sgsvm.dao.IArticuloDao;
import ar.com.sgsvm.dao.IClienteDao;
import ar.com.sgsvm.entity.Articulo;

public class ArticuloLogica {

	private DaoFactory mDaoFactory = DaoFactory.getDaoFactory(DaoFactory.SQLITE);
	private IArticuloDao mArticuloDao= mDaoFactory.getArticuloDao();

	public List<Articulo> listadoArticulos() throws Exception {
		IArticuloDao articuloDao = mDaoFactory.getArticuloDao();
		return articuloDao.readAll();
	}

	public Articulo obtener(long id) throws Exception {
		return mDaoFactory.getArticuloDao().readById(id);
	}
	public void CrearArticulo (Articulo articulo) throws Exception {
		mArticuloDao.create(articulo);
		mDaoFactory.commit();
		
		
	}
}
